﻿<Window x:Class="WpfStudy.StudyCommand"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="StudyCommand" Height="300" Width="300">
    <Window.Resources>
        <RoutedCommand x:Key="MyCmd"/>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource MyCmd}" CanExecute="MyCmd_CanExecute" Executed="MyCmd_Executed"/>
    </Window.CommandBindings>
    <Grid>
        <CheckBox Command="{StaticResource MyCmd}"
                  CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource Self}}"
                  Content="I have been binded to a command"/>
    </Grid>
</Window>
